ExamPlay Light Logo
Masuk

Computer Science for IGCSE & O level - Algorithm Design And Problem Solving (Section 7 - No. 42)

In the provided bubble sort algorithm, what is the purpose of the nested loop (the inner `FOR` loop)?
To set the temperature to a given range.
To compare and swap adjacent elements.
To define the number of elements in the list.
To output the sorted list.

Penjelasan

The inner loop compares and swaps adjacent elements in the list, during each pass.

Komentar (0)

Masuk Untuk Berkomentar
Iklan
BrainBehindX Inc Logo
©2026; Didukung oleh BrainBehindX Inc